package interfaces;

import java.io.IOException;
import java.rmi.Remote;
import java.rmi.RemoteException;

import valueObjects.game.Player;
import valueObjects.game.card.Card;

public interface IClientReciever extends Remote{

	/**
	 * Receiver for cards
	 * @param c
	 * @throws RemoteException
	 */
	public void recieveCard(Card c) throws RemoteException;

	/**
	 * Receiver game starting
	 * @throws RemoteException
	 */
	public void recieveStartGame() throws RemoteException;
	
	/**
	 * Receiver for chatmessages
	 * @param nickname
	 * @param message
	 * @throws RemoteException
	 */
	public void receiveMessage(String nickname, String message) throws RemoteException;
	
	/**
	 * Receiver for checking if the given player p won
	 * @param p
	 * @throws RemoteException
	 * @throws IOException 
	 */
	public void finish(Player p) throws RemoteException, IOException;

	/**
	 * Reciever for asking other players for interaction
	 * @param p
	 * @return
	 * @throws RemoteException
	 * @throws InterruptedException
	 */
	IClientSender recieveInteraction(Player p) throws RemoteException, InterruptedException;

	/**
	 * Reciever for updating the hand cards
	 * @param player
	 * @throws RemoteException
	 */
	public void recieveUpdateHandCards(Player player) throws RemoteException;

	/**
	 * Reciever for asking other players for help
	 * @param p
	 * @return
	 * @throws RemoteException
	 * @throws InterruptedException
	 */
	public Player recieveAskForHelp(Player p) throws RemoteException, InterruptedException;

	/**
	 * Reciever when a player could not escape or win a fight
	 * @throws RemoteException
	 */
	public void recieveBadThings() throws RemoteException;

	/**
	 * Reciever for asking others if they want to save the game
	 * @param player
	 * @throws RemoteException 
	 */
	public boolean recieveAskForSave(Player player) throws RemoteException;

	/**
	 * Checks whether cards are played
	 * @return boolean
	 */
	public boolean cardPlayed() throws RemoteException;

	/**
	 * When a player reaches the win level
	 * @param p
	 */
	public void sendWin(Player p) throws RemoteException;

	void receiveLoadedGame(IGameManagement manager) throws RemoteException;

	public void recieveCardInteract() throws RemoteException;

	public void waitForCad() throws RemoteException;

}
